<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	
	<SCRIPT src="../../../NCProjectWeb/js/jquery.min.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="../../../NCProjectWeb/js/moment.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="../../../NCProjectWeb/js/bootstrap-datetimepicker.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="../../../NCProjectWeb/js/bootstrap-datetimepicker.ru.js" type="text/javascript"></SCRIPT>
    <link href="../../../NCProjectWeb/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="../../../NCProjectWeb/css/bootstrap-datetimepicker.min.css">
	<script type="text/javascript" src="../../../NCProjectWeb/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../../NCProjectWeb/js/moment.js"></script>
	
	<title>New Flight</title>
	
</head>
<body>
	<script> <!-- for inputs-->
		$(function () {
		$('#deptime').datetimepicker({language: 'ru'});
		$('#arrtime').datetimepicker({language: 'ru'});
		});
	</script>


	<%@ page import="entities.*" %>
	<%@ page import="java.util.ArrayList" %>	
 
 <%
 	ArrayList<Airline> list = (ArrayList<Airline>) request.getAttribute("airlineList");
 	ArrayList<Aircraft> aircrList = (ArrayList<Aircraft>) request.getAttribute("aircraftList");
 	ArrayList<Airport> airpList = (ArrayList<Airport>) request.getAttribute("airportList");
 %>
	<form class="form-horizontal" method="Get" action="/NCProjectWeb/createFlight">
			<div class="controls" style="text-align: center;">
				<h3>Создание нового рейса</h3>
			</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">Номер рейса</label> 
			<div class="col-sm-5">
				<input type="text" class="form-control" name="flightnumber" placeholder="Flight number">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">Компания</label>
			<div class="col-sm-5">
				<select class="form-control" name="flightairline">
					<option disabled selected>Выберите компанию</option>
				<% for (int i = 0; i < list.size(); i++) {%>
					<option><%=list.get(i).getAirlineName()%></option>
				<% } %>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">Самолет</label> 
			<div class="col-sm-5">
				<select class="form-control" name="flightaircraft">
					<option disabled selected>Выберите самолет</option>
				<% for (int i = 0; i < aircrList.size(); i++) {%>
					<option><%=aircrList.get(i).getAircraftType()%></option>
				<% } %>
				</select>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-md-4">
				<div class="form-group">
					<div class="col-sm-6"></div>
					<div class="col-sm-6">
						<h5>Эконом класс</h5>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-6 control-label">Цены</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="price_ec">
					</div>
				
				</div>
				<div class="form-group">
					<label class="col-sm-6 control-label">Доступно мест</label> 
					<div class="col-sm-6">
						<input type="text" class="form-control" name="av_ec">
					</div>
				</div>
			</div>
			<div class="col-md-4">
				<div class="form-group">
					<div class="col-sm-3"></div>
					<div class="col-sm-6">
						<h5>Бизнес класс</h5>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-3"></div>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="price_bc">
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-3"></div>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="av_bc">
					</div>
				</div>
			</div>
			<div class="col-md-4">
				<div class="form-group">
					<div class="col-sm-6">
						<h5>Первый класс</h5>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-6">
						<input type="text" class="form-control" name="price_fc">
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-6">
						<input type="text" class="form-control" name="av_fc">
					</div>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-md-6">
				<div class="form-group">
					<div class="col-sm-4"></div>
					<div class="col-sm-8">
						<h5><b>Откуда</b></h5>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-4"></div>
					<div class="col-sm-8">
						<select class="form-control" name="depairport">
							<option disabled selected>Выберите аэропорт</option>
							<% for (int i = 0; i < airpList.size(); i++) {%>
								<option><%=airpList.get(i).getAirportName()%></option>
							<% } %>
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-4"></div>
					<div class="col-sm-8">
						<div class="input-group date" id="deptime">
							<input class="form-control" name="deptime" type="text"  placeholder="Введите дату и время" autocomplete="off">
							<SPAN class="input-group-addon">
							<SPAN class="glyphicon glyphicon-calendar"></SPAN>
							</SPAN>
						</DIV>
					</div>
				</div>
			</div>
			<div class="col-md-6">
				<div class="form-group">
					<div class="col-sm-2"></div>
					<div class="col-sm-8">
						<h5><b>Куда</b></h5>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2"></div>
					<div class="col-sm-8">
						<select class="form-control" name="arrairport">
							<option disabled selected>Выберите аэропорт</option>
							<% for (int i = 0; i < airpList.size(); i++) {%>
								<option><%=airpList.get(i).getAirportName()%></option>
							<% } %>
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2"></div>
					<div class="col-sm-8">
						<!-- <input type="text" class="form-control" name="arrtime" placeholder="Input Time"> -->
							<div class="input-group date" id="arrtime">
								<input class="form-control" name="arrtime" type="text"  placeholder="Введите дату и время" autocomplete="off">
								<SPAN class="input-group-addon">
								<SPAN class="glyphicon glyphicon-calendar"></SPAN>
								</SPAN>
							</DIV>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-3"></div>
			<input type="submit" class="btn btn-default" value="Создать">
			<a class="btn btn-default" href="${pageContext.request.contextPath}/admin/index.jsp" role="button">Home</a>
		</div>
	</form>
</body>
</html>